#!/user/bin/env jython
# -*- coding: utf-8 -*-

from java.io import *

class JHTMLGenerator:
	
	def __init__(self):
	
	
		pass
	
	def firstQuery(self, listTeachers, establishment, year):
		
		f = FileOutputStream("query1.html")
		
		PrintStream(f).println ("<html><body>")
		PrintStream(f).println ("<head><meta http-equiv='content-type' content='text/html;charset=utf-8' /></head><h1>")
		PrintStream(f).println ("Teachers per establishment per year</h1>")
		PrintStream(f).println ("<h3>Establishment: " + establishment + "</h3>")
		PrintStream(f).println ("<h3>Year: " + year + "</h3><br>")
		PrintStream(f).println ("<ul>")
		
		for element in listTeachers:
			PrintStream(f).println ("<li>" + element + "</li>")
			pass
		
		PrintStream(f).println ("</ul></body></html>")
		
		f.close()
	
	def secondQuery(self, listTeachers, establishment, year, categorie):
		
		f = FileOutputStream("query2.html")
		
		PrintStream(f).println ("<html><body>")
		PrintStream(f).println ("<head><meta http-equiv='content-type' content='text/html;charset=utf-8' /></head><h1>")
		PrintStream(f).println ("Teachers per establishment per year</h1>")
		PrintStream(f).println ("<h3>Establishment: " + establishment + "</h3>")
		PrintStream(f).println ("<h3>Year: " + year + "</h3>")
		PrintStream(f).println ("<h3>Categorie: " + categorie + "</h3><br>")
		PrintStream(f).println ("<ul>")
		
		for element in listTeachers:
			PrintStream(f).println ("<li>" + element + "</li>")
			pass
		
		PrintStream(f).println ("</ul></body></html>")
		
		f.close()
		pass
		
	def thirdQuery(self, listTeachers, establishment, year, degree):
		f = FileOutputStream("query3.html")
		
		PrintStream(f).println ("<html><body>")
		PrintStream(f).println ("<head><meta http-equiv='content-type' content='text/html;charset=utf-8' /></head><h1>")
		PrintStream(f).println ("Teachers per establishment per year</h1>")
		PrintStream(f).println ("<h3>Establishment: " + establishment + "</h3>")
		PrintStream(f).println ("<h3>Year: " + year + "</h3>")
		PrintStream(f).println ("<h3>Degree: " + degree + "</h3><br>")
		PrintStream(f).println ("<ul>")
		
		for element in listTeachers:
			PrintStream(f).println ("<li>" + element + "</li>")
			pass
		
		PrintStream(f).println ("</ul></body></html>")
		
		f.close()
		pass
		
